Optimal. Leaf size=110 \[ -\frac{2 a^3 (c-i d) \tan (e+f x)}{f}-\frac{4 a^3 (d+i c) \log (\cos (e+f x))}{f}+4 a^3 x (c-i d)+\frac{a (d+i c) (a+i a \tan (e+f x))^2}{2 f}+\frac{d (a+i a \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0952098, antiderivative size = 110, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3527, 3478, 3477, 3475} \[ -\frac{2 a^3 (c-i d) \tan (e+f x)}{f}-\frac{4 a^3 (d+i c) \log (\cos (e+f x))}{f}+4 a^3 x (c-i d)+\frac{a (d+i c) (a+i a \tan (e+f x))^2}{2 f}+\frac{d (a+i a \tan (e+f x))^3}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3527
Rule 3478
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx &=\frac{d (a+i a \tan (e+f x))^3}{3 f}-(-c+i d) \int (a+i a \tan (e+f x))^3 \, dx\\ &=\frac{a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac{d (a+i a \tan (e+f x))^3}{3 f}+(2 a (c-i d)) \int (a+i a \tan (e+f x))^2 \, dx\\ &=4 a^3 (c-i d) x-\frac{2 a^3 (c-i d) \tan (e+f x)}{f}+\frac{a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac{d (a+i a \tan (e+f x))^3}{3 f}+\left (4 a^3 (i c+d)\right ) \int \tan (e+f x) \, dx\\ &=4 a^3 (c-i d) x-\frac{4 a^3 (i c+d) \log (\cos (e+f x))}{f}-\frac{2 a^3 (c-i d) \tan (e+f x)}{f}+\frac{a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac{d (a+i a \tan (e+f x))^3}{3 f}\\ \end{align*}
Mathematica [B] time = 4.29233, size = 331, normalized size = 3.01 \[ \frac{a^3 \sec (e) \sec ^3(e+f x) \left (3 \cos (f x) \left ((-3 d-3 i c) \log \left (\cos ^2(e+f x)\right )+6 c f x-i c-6 i d f x-3 d\right )+3 \cos (2 e+f x) \left ((-3 d-3 i c) \log \left (\cos ^2(e+f x)\right )+6 c f x-i c-6 i d f x-3 d\right )+9 c \sin (2 e+f x)-9 c \sin (2 e+3 f x)+6 c f x \cos (2 e+3 f x)+6 c f x \cos (4 e+3 f x)-3 i c \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 i c \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )-18 c \sin (f x)-15 i d \sin (2 e+f x)+13 i d \sin (2 e+3 f x)-6 i d f x \cos (2 e+3 f x)-6 i d f x \cos (4 e+3 f x)-3 d \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 d \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )+24 i d \sin (f x)\right )}{12 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.011, size = 160, normalized size = 1.5 \begin{align*}{\frac{-{\frac{i}{3}}{a}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{3}d}{f}}-{\frac{{\frac{i}{2}}{a}^{3}c \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{4\,i{a}^{3}d\tan \left ( fx+e \right ) }{f}}-{\frac{3\,{a}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{2}d}{2\,f}}-3\,{\frac{{a}^{3}c\tan \left ( fx+e \right ) }{f}}+{\frac{2\,i{a}^{3}\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c}{f}}+2\,{\frac{{a}^{3}\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) d}{f}}-{\frac{4\,i{a}^{3}\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f}}+4\,{\frac{{a}^{3}\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.54406, size = 147, normalized size = 1.34 \begin{align*} -\frac{2 i \, a^{3} d \tan \left (f x + e\right )^{3} -{\left (-3 i \, a^{3} c - 9 \, a^{3} d\right )} \tan \left (f x + e\right )^{2} - 24 \,{\left (a^{3} c - i \, a^{3} d\right )}{\left (f x + e\right )} - 6 \,{\left (2 i \, a^{3} c + 2 \, a^{3} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \,{\left (3 \, a^{3} c - 4 i \, a^{3} d\right )} \tan \left (f x + e\right )}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.58663, size = 508, normalized size = 4.62 \begin{align*} -\frac{2 \,{\left (9 i \, a^{3} c + 13 \, a^{3} d + 12 \,{\left (i \, a^{3} c + 2 \, a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \,{\left (7 i \, a^{3} c + 11 \, a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \,{\left (i \, a^{3} c + a^{3} d +{\left (i \, a^{3} c + a^{3} d\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \,{\left (i \, a^{3} c + a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \,{\left (i \, a^{3} c + a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \,{\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 5.78776, size = 172, normalized size = 1.56 \begin{align*} - \frac{4 a^{3} \left (i c + d\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac{- \frac{\left (8 i a^{3} c + 16 a^{3} d\right ) e^{- 2 i e} e^{4 i f x}}{f} - \frac{\left (14 i a^{3} c + 22 a^{3} d\right ) e^{- 4 i e} e^{2 i f x}}{f} - \frac{\left (18 i a^{3} c + 26 a^{3} d\right ) e^{- 6 i e}}{3 f}}{e^{6 i f x} + 3 e^{- 2 i e} e^{4 i f x} + 3 e^{- 4 i e} e^{2 i f x} + e^{- 6 i e}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.53138, size = 450, normalized size = 4.09 \begin{align*} \frac{-12 i \, a^{3} c e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 12 \, a^{3} d e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 i \, a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 \, a^{3} d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 i \, a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 \, a^{3} d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 24 i \, a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} - 48 \, a^{3} d e^{\left (4 i \, f x + 4 i \, e\right )} - 42 i \, a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} - 66 \, a^{3} d e^{\left (2 i \, f x + 2 i \, e\right )} - 12 i \, a^{3} c \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 12 \, a^{3} d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 18 i \, a^{3} c - 26 \, a^{3} d}{3 \,{\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]